home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / os2 / sysb091a.zip / sysbench / src / pmb_dhry.h < prev    next >
Text File  |  1994-11-05  |  16KB  |  398 lines

  1. /*
  2.  *************************************************************************
  3.  *
  4.  *                   "DHRYSTONE" Benchmark Program
  5.  *                   -----------------------------
  6.  *
  7.  *  Version:    C, Version 2.1
  8.  *
  9.  *  File:       dhry.h (part 1 of 3)
  10.  *
  11.  *  Date:       May 25, 1988
  12.  *
  13.  *  Author:     Reinhold P. Weicker
  14.  *              Siemens Nixdorf Inf. Syst.
  15.  *              STM OS 32
  16.  *              Otto-Hahn-Ring 6
  17.  *              W-8000 Muenchen 83
  18.  *              Germany
  19.  *                      Phone:    [+49]-89-636-42436
  20.  *                                (8-17 Central European Time)
  21.  *                      UUCP:     weicker@ztivax.uucp@unido.uucp
  22.  *                      Internet: weicker@ztivax.siemens.com
  23.  *
  24.  *              Original Version (in Ada) published in
  25.  *              "Communications of the ACM" vol. 27., no. 10 (Oct. 1984),
  26.  *              pp. 1013 - 1030, together with the statistics
  27.  *              on which the distribution of statements etc. is based.
  28.  *
  29.  *              In this C version, the following C library functions are
  30.  *              used:
  31.  *              - strcpy, strcmp (inside the measurement loop)
  32.  *              - printf, scanf (outside the measurement loop)
  33.  *
  34.  *  Collection of Results:
  35.  *              Reinhold Weicker (address see above) and
  36.  *              
  37.  *              Rick Richardson
  38.  *              PC Research. Inc.
  39.  *              94 Apple Orchard Drive
  40.  *              Tinton Falls, NJ 07724
  41.  *                      Phone:  (201) 834-1378 (9-17 EST)
  42.  *                      UUCP:   ...!uunet!pcrat!rick
  43.  *
  44.  *      Please send results to Rick Richardson and/or Reinhold Weicker.
  45.  *      Complete information should be given on hardware and software
  46.  *      used. Hardware information includes: Machine type, CPU, type and
  47.  *      size of caches; for microprocessors: clock frequency, memory speed
  48.  *      (number of wait states). Software information includes: Compiler
  49.  *      (and runtime library) manufacturer and version, compilation
  50.  *      switches, OS version. The Operating System version may give an
  51.  *      indication about the compiler; Dhrystone itself performs no OS
  52.  *      calls in the measurement loop.
  53.  *
  54.  *      The complete output generated by the program should be mailed
  55.  *      such that at least some checks for correctness can be made.
  56.  *
  57.  *************************************************************************
  58.  *
  59.  *  History:    This version C/2.1 has been made for two reasons:
  60.  *
  61.  *              1) There is an obvious need for a common C version of
  62.  *              Dhrystone, since C is at present the most popular system
  63.  *              programming language for the class of processors
  64.  *              (microcomputers, minicomputers) where Dhrystone is used
  65.  *              most. There should be, as far as possible, only one C
  66.  *              version of Dhrystone such that results can be compared
  67.  *              without restrictions. In the past, the C versions
  68.  *              distributed by Rick Richardson (Version 1.1) and by
  69.  *              Reinhold Weicker had small (though not significant)
  70.  *              differences.
  71.  *
  72.  *              2) As far as it is possible without changes to the
  73.  *              Dhrystone statistics, optimizing compilers should be
  74.  *              prevented from removing significant statements.
  75.  *
  76.  *              This C version has been developed in cooperation with
  77.  *              Rick Richardson (Tinton Falls, NJ), it incorporates many
  78.  *              ideas from the "Version 1.1" distributed previously by
  79.  *              him over the UNIX network Usenet.
  80.  *              I also thank Chaim Benedelac (National Semiconductor),
  81.  *              David Ditzel (SUN), Earl Killian and John Mashey (MIPS),
  82.  *              Alan Smith and Rafael Saavedra-Barrera (UC at Berkeley)
  83.  *              for their help with comments on earlier versions of the
  84.  *              benchmark.
  85.  *
  86.  *  Changes:    In the initialization part, this version follows mostly
  87.  *              Rick Richardson's version distributed via Usenet, not the
  88.  *              version distributed earlier via floppy disk by Reinhold
  89.  *              Weicker. As a concession to older compilers, names have
  90.  *              been made unique within the first 8 characters. Inside the
  91.  *              measurement loop, this version follows the version
  92.  *              previously distributed by Reinhold Weicker.
  93.  *
  94.  *              At several places in the benchmark, code has been added,
  95.  *              but within the measurement loop only in branches that
  96.  *              are not executed. The intention is that optimizing
  97.  *              compilers should be prevented from moving code out of the
  98.  *              measurement loop, or from removing code altogether. Since
  99.  *              the statements that are executed within the measurement
  100.  *              loop have NOT been changed, the numbers defining the
  101.  *              "Dhrystone distribution" (distribution of statements,
  102.  *              operand types and locality) still hold. Except for
  103.  *              sophisticated optimizing compilers, execution times for
  104.  *              this version should be the same as for previous versions.
  105.  *
  106.  *              Since it has proven difficult to subtract the time for the
  107.  *              measurement loop overhead in a correct way, the loop check
  108.  *              has been made a part of the benchmark. This does have
  109.  *              an impact - though a very minor one - on the distribution
  110.  *              statistics which have been updated for this version.
  111.  *
  112.  *              All changes within the measurement loop are described
  113.  *              and discussed in the companion paper "Rationale for
  114.  *              Dhrystone version 2".
  115.  *
  116.  *              Because of the self-imposed limitation that the order and
  117.  *              distribution of the executed statements should not be
  118.  *              changed, there are still cases where optimizing compilers
  119.  *              may not generate code for some statements. To a certain
  120.  *              degree, this is unavoidable for small synthetic
  121.  *              benchmarks. Users of the benchmark are advised to check
  122.  *              code listings whether code is generated for all statements
  123.  *              of Dhrystone.
  124.  *
  125.  *              Version 2.1 is identical to version 2.0 distributed via
  126.  *              the UNIX network Usenet in March 1988 except that it
  127.  *              corrects some minor deficiencies that were found by users
  128.  *              of version 2.0. The only change within the measurement
  129.  *              loop is that a non-executed "else" part was added to the
  130.  *              "if" statement in Func_3, and a non-executed "else" part
  131.  *              removed from Proc_3.
  132.  *
  133.  *************************************************************************
  134.  *
  135.  * Defines:     The following "Defines" are possible:
  136.  *              -DROPT         (default: Not defined)
  137.  *                      As an approximation to what an average C
  138.  *                      programmer might do, the "register" storage class
  139.  *                      is applied (if enabled by -DROPT)
  140.  *                      - for local variables, if they are used
  141.  *                        (dynamically) five or more times
  142.  *                      - for parameters if they are used (dynamically)
  143.  *                        six or more times
  144.  *                      Note that an optimal "register" strategy is
  145.  *                      compiler-dependent, and that "register"
  146.  *                      declarations do not necessarily lead to faster
  147.  *                      execution.
  148.  *              -DNOSTRUCTASSIGN        (default: Not defined)
  149.  *                      Define if the C compiler does not support
  150.  *                      assignment of structures.
  151.  *              -DNOENUMS               (default: Not defined)
  152.  *                      Define if the C compiler does not support
  153.  *                      enumeration types.
  154.  *
  155.  *************************************************************************
  156.  *
  157.  *  Compilation model and measurement (IMPORTANT):
  158.  *
  159.  *  This C version of Dhrystone consists of three files:
  160.  *  - dhry.h (this file, containi